<?php
                global $db;
                if($_SESSION['sid'] == ''){
                        fs_showmsg("您还没有登录!","?do=xx");
                }else
                {
                        //视频数 +1
                        $video_id = $_GET['video_id'];
                        $sql_update = "update nettteach_videos set times = times+1";
                        $result_update = $db -> query($sql_update);
                        //插入操作记录
                        $insert_sql  = "insert into nettteach_record (`uid`,`cid`,`datetime`,`type`) values(".$_SESSION['sid'].",".$video_id.",".time().",1)";
                        $result = $db -> query($insert_sql);
                        
                        //查询选择视频
                        $sql = "select * from nettteach_videos where id = ".$video_id;
                        $result_video = $db -> query($sql);
                        if($row_video=$db->fetch_array($result_video)){

?>
<script type="text/javascript">
   function godownload(dowloadid)
    {
        window.location.href = 'main/courseware/download_courseware.php?courseware_id='+dowloadid;
    }
    </script>
          <div title="<?php echo($row_video['title']);?> "  style="float:left; padding-left:8px;width: 690px;"  class="zss_201108221423">
              <span style="padding-left: 8px; font-size: 14px; float: left;">
                <a style="color: #fff;" href="javascript:history.go(-1)" style=" color:#FFF;"> 返回 </a>&nbsp;&nbsp;&nbsp;&nbsp;
                    <a style="color: #fff;" href="javascript:void(0);" onClick="document.MediaPlayer.FullScreen=true;">全屏播放</a>
              </span>
                <?php echo($row_video['title']);?> 
          </div>
          <div   style="float:left;padding-bottom: 5px; ">
                <!---->
                <object height="600" width="700"id="MediaPlayer" class="zss_201109161806" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" viewastext="VIEWASTEXT"> 
                <param NAME="AutoStart" VALUE="1" title="友情提示:双击切换到全屏播放"> 
                <!--是否自动播放--> 

                <param NAME="Balance" VALUE="0"> 
                <!--调整左右声道平衡,同上面旧播放器代码--> 

                <param name="enabled" value="1"> 
                <!--播放器是否可人为控制--> 

                <param NAME="EnableContextMenu" VALUE="0"> 
                <!--是否启用右键菜单--> 

                <param NAME="url" value="<?php echo("./teacher".$row_video['address'])?>"> 
                <!--播放的文件地址--> 

                <param NAME="PlayCount" VALUE="20"> 
                <!--播放次数控制,为整数--> 

                <param name="EnablePositionControls" value="-1">
                <param name="EnableFullScreenControls" value="-1">
                <param name="EnableTracker" value="-1">
                <!--是否允许拉动播放进度条到任意地方播放-->

                <param name="rate" value="1"> 
                <!--播放速率控制,1为正常,允许小数,1.0-2.0--> 
                <param name="currentPosition" value="0"> 
                <!--控件设置:当前位置--> 
                <param name="currentMarker" value="0"> 
                <!--控件设置:当前标记--> 
                <param name="defaultFrame" value=""> 
                <!--显示默认框架--> 
                <param name="invokeURLs" value="0"> 
                <!--脚本命令设置:是否调用URL--> 
                <param name="baseURL" value=""> 
                <!--脚本命令设置:被调用的URL--> 
                <param name="stretchToFit" value="0"> 
                <!--是否按比例伸展--> 
                <param name="volume" value="100"> 
                <!--默认声音大小0%-100%,50则为50%--> 
                <param name="mute" value="0"> 
                <!--是否静音--> 
                <param name="uiMode" value="Full"> 
                <!--播放器显示模式:Full显示全部;mini最简化;None不显示播放控制,只显示视频窗口;invisible全部不显示--> 
                <param name="windowlessVideo" value="0"> 
                <!--如果是0可以允许全屏,否则只能在窗口中查看--> 
                <param name="fullScreen" value="0"> 
                <!--开始播放是否自动全屏--> 
                <param name="enableErrorDialogs" value="-1"> 
                <!--是否启用错误提示报告--> 
                <param name="SAMIStyle" value> 
                <!--SAMI样式--> 
                <param name="SAMILang" value> 
                <!--SAMI语言--> 
                <param name="SAMIFilename" value> 
                <!--字幕ID--> 
                <param name=DisplaySize value="4">
                </object>
            </div>
<script type='text/javascript'>
function dopost(){
 note=$('#note').val();
 if(note==''){
     alert('笔记不能为空');
     return false;
 }
// notelist =document.getElementById('notelist');//出现意外的错误
 $.ajax({
   url:"./main/videos/showmessage.php",//提交到的url action
   timeout:1000,//延迟时间 如果1000 return error
   data:'content='+note+"&id="+<?php echo $_SESSION['sid']?>,//     <input name=content value=note />
   dataType:"html",//xml 
   type:"POST",// method=post
   ansync:false,
   error:function(){alert("出错啦!请刷新页面");},
   
   
   success:function (html){

    $('#notelist').html($(html));
    document.getElementById('note').value='';
   }
   })
}
</script>
    <div style="float:left; padding-left:20px" class="note">
      <h3>快捷记事本</h3> 
      <form>
          <textarea cols="25" rows="10"  name="note" class="notetext" id="note"></textarea><br/>
          <input type="button" onclick="dopost()" value="保存" name="sub" style="margin-top:3px;" />
      </form>
      <div class="note">
          <ul id="notelist">
        <?php 
        $title_sql ="select * from nettteach_note where userid = ".$_SESSION['sid']." order by time DESC limit 0,3";
        $title_query =$db->query($title_sql);
        while($title_result =$db->fetch_array($title_query)){
			$title_content=mb_substr($title_result["content"],0,16,'utf-8');
		 ?>
			<li style="padding: 5px;"><a STYLE="COLOR:BLUE;" title="<?php echo($title_result["content"]);?>" href="?do=note&id=<?php echo($title_result["id"]);?>"><?php echo($title_content);?></a><br/>(<?php echo(date("Y-m-d H:i:s",$title_result["time"]));?>)</li>
		 <?php
        }
        ?>
          </ul>
        <?php 
        $num_sql ="select content,id,time from nettteach_note where userid = ".$_SESSION['sid']."";
        $num_query =$db->query($num_sql);
	$num_num=$db->num_rows($num_query);
         ?>
          <div align="right"><a href="?do=notelist">更多</a></div>
      </div>
      <h3>相关课件</h3>
      <div class="hotvideo">
          <ul>
              <?php
//              $array = explode(',',$row_video['belong']);
              if($row_video['belong'] != '')
              {
                      $sql_courseware = "select * from nettteach_courseware where id in (".$row_video['belong'].")";
                      $result = $db -> query($sql_courseware);
                      while($row = $db->fetch_array($result))
                      {
                          if($row['size']=='')
                          {
                              $row['size'] =0;
                          }
                          if($row['introduction']=='')
                          {
                              $row['introduction'] ="暂无";
                          }
                           echo '<li style="padding: 5px;" title="点击下载 文件大小:'.$row['size'].'兆 简介:'.$row['introduction'].'"><a href="javascript:void(0)" onclick="godownload('.$row['id'].')">'.$row['title'].'</a>';   
                      }
              }else{
                      echo '<li>暂无相关课件</li>';   
              }
               
              ?>
          </ul>
      </div>
<!--      <div style="padding:5px;text-align: center;">
          <input type="submit" value="相关课件"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="课后练习" onclick="alert('暂无相关练习题！');return false;" />
      </div>-->

<?php
                        }
        }
?>
    </div>

